module.exports = (req, res) => {
  require('../util/service').handlePost(req, res, (reqObj, resolve) => {
    require('../dao/htmlDao').select({
      html_id: reqObj.html_id
    }, htmls => {
      if (htmls.length == 0) {
        resolve({
          result: -1,
          msg: '找不到html'
        })
        return
      }
      var html = htmls[0]
      if (html.needLogin && !req.session.user) {
        resolve({
          result: 0,
          msg: '请先登录'
        })
        return
      }
      resolve({
        result: 1,
        html: html
      })
    })
  })
}
